<!DOCTYPE HTML>
<html>
  <head>
    <title><?php echo SITE_NAME; ?> | 团购导航网站大全</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="keywords" content=" 团购, 导航, 拉手, 美团, <?php echo SITE_NAME; ?>">
    <meta name="description" content="中国最精准全面又实惠的团购导航网站">
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>code/ttz.css" media="screen">
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>code/cupertino/jquery-ui-1.8.10.custom.css" media="screen">
    <script type="text/javascript" src="<?php echo base_url(); ?>code/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>code/jquery-ui.js"></script>
    <link rel="shortcut icon" href="<?php echo base_url(); ?>code/images/icon.ico" />
    <script type="text/javascript" src="<?php echo base_url(); ?>code/ttz.js"></script>
  </head>
  <script type="text/javascript">
        <?php if (!$finished){
            echo "window.onload=function() {setTimeout('window.location.replace(window.location.href)',";
            echo $interval;
            echo ");};";
        }?>
  </script>
  <body>
    <div id="wrapper">
      <div class="wrap">
	  	<?php if ($finished){ 
					echo '<h2>抓取完成</h2>';
					foreach ($site_info as $ss){
						echo '<h4>从站点 ';
						echo $ss['sn'];
						echo ' 抓取了 ';
						echo $ss['gc'];
						echo ' 个团购信息。</h4>';
					}
					if (count($site_info) == 0){
						echo '<h4>本次没有API需要被抓取，请检查上次抓取时间。</h4>';
						echo "<h4>每个站点抓取时间间隔是 " . CRAW_INTERVAL . " 小时</h4>";
					}
		} else { 
					echo '<h2>抓取进行中，请勿关闭浏览器</h2>';
					echo '<h4>从站点： ';
					echo $site_info['sn'];
					echo ' 已经抓取了 ';
					echo $site_info['gc'];
					echo ' 个团购信息。</h4>';
					echo '<h5>如果浏览器没有反应，请点击此链接<a href="';
					echo base_url(); 
					echo 'index.php/cron/regular_craw">这里</a></h5>';
				}
		?>
      </div><!-- end .wrap -->
    </div><!-- end #wrapper -->
    <div class="clear"></div>
</body>
</html>